﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wjtour.Common;
using Hjp.FrameWork.Common;
using System.Linq;

namespace Wjtour.Web.Front
{
    public partial class galleryshow : BasePage
    {
        private Wjtour.BLL.gallery_bll _gallery_bll = new BLL.gallery_bll();
        protected int id = 0;
        protected List<Wjtour.Domain.dto.sitepicture_picturetype> pictures = new List<Domain.dto.sitepicture_picturetype>();
        protected string galleryname;
        protected string galleryaddtime;
        protected int prevGalleryId = 1;
        protected int nextGalleryId = 1;

        protected void Page_Load(object sender, EventArgs e)
        {
            id = Utils.StrToInt(Request["id"], 0);
            pictures = _gallery_bll.GetGalleryPicturesList(id);
            prevGalleryId = _gallery_bll.GetPrevGalleryId(id);
            if (prevGalleryId == 0) prevGalleryId = id;
            nextGalleryId = _gallery_bll.GetNextGalleryId(id);
            if (nextGalleryId == 0) nextGalleryId = id;

            if (pictures != null)
            {
                galleryname = pictures.First().galleryname;
                galleryaddtime = pictures.First().galleryaddtime.HasValue ? pictures.First().galleryaddtime.Value.ToString("yyyy-MM-dd") : "";
            }
        }
    }
}
